package osSRC.schedule;

abstract class PCB {
	String processName;
	int priority;
	int CPU_Time;
	int needTime;
	String state;
	public String getState() {
		return state;
	}
	public int getPriority(){return this.priority;}
	PCB(){}
	PCB(String name,int needTime){
		this.processName=name;
		this.needTime=needTime;
		this.CPU_Time =0;
	}
	boolean checkFinished(){
		boolean result=this.needTime==0;
		if(result)
				this.state="F";
		else	this.state="W";
		return result;
	}

	@Override
	public String toString() {
		return this.processName+"\t\t"
				+this.CPU_Time +"\t\t\t"
				+this.needTime+"\t\t"
				+this.state+"\t\t";
	}

	abstract int call(int timeSlice);
	int wait(int timeSlice){
		return 0;
	}
}
